<?php
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.libs.view.templates.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>

<?php $current = $this->Session->read('Auth');
 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php __('iDunnit: Tasking Simplified:'); ?>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
            echo $this->Html->css('cake.generic');
            echo $this->Html->css('style');
            echo $scripts_for_layout;
	?>
</head>
<body>
	<div id="wrapper">
		<div id="header">
                    <div id="logo">
                        <?php
                        echo $this->Html->link($this->Html->image('logo.png', array('alt' => 'iDunnit: Tasking Simplified')),
                                array('controller' => 'pages', 'action' => 'home'), array('escape' => false));
                        ?>
                    </div>
                    <div id="navtop">
                        <ul class="navigation">
                            <li><?php echo $this->Html->link('Home', array('controller' => 'pages', 'action' => 'home'), array('class' => 'first')); ?></li>
                            <li><?php echo $this->Html->link('Requirements', array('controller' => 'pages', 'action' => 'requirements')); ?></li>
                            <?php if(!empty($current['User'])) {
                                echo"<li>".$this->Html->link('Profile', array('controller' => 'users', 'action' => 'view/'.$current['User']['id']))."</li>";
                                echo "<li>".$this->Html->link('Logout', array('controller' => 'users', 'action' => 'logout'), array('class' => 'last'))."</li>";
                            } else {
                                echo "<li>".$this->Html->link('Register', array('controller' => 'users', 'action' => 'add'))."</li>";
                                echo "<li>".$this->Html->link('Login',  array('controller' => 'users', 'action' => 'login'), array('class' => 'last'))."</li>";
                            } ?>
                        </ul>
                    </div>
                </div>
		<div id="content" class="clearfix">

			<?php echo $this->Session->flash(); ?>

			<?php echo $content_for_layout; ?>

		</div>
		<div id="footer">
                    <ul class="navigation">
                        <li><?php echo $this->Html->link('Home', array('controller' => 'pages', 'action' => 'home')); ?></li>|
                        <li><?php echo $this->Html->link('Repository', 'http://code.google.com/p/idunnit/'); ?></li>|
                        <li><?php echo $this->Html->link('Source Code', 'http://code.google.com/p/idunnit/source/browse/'); ?></li>|
                        <li><?php echo $this->Html->link('Apache License 2.0', 'http://www.apache.org/licenses/LICENSE-2.0'); ?></li>|
                        <li><?php echo $this->Html->link('Contributors', 'http://code.google.com/p/idunnit/people/list'); ?></li>
                    </ul>
		</div>
    </div>
    <!-- /Wrapper -->
    <?php echo $this->element('sql_dump'); ?>
</body>
</html>
